﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.LightSwitch;
namespace LightSwitchApplication
{
    public partial class Address
    {
        partial void FullAddress_Compute(ref string result)
        {
            result = this.AddressLine1 
                + (string.IsNullOrEmpty(this.AddressLine2) ? "" : ", "+ this.AddressLine2)
                + (this.City != null ? ", " + this.City.Name : "")
                + (this.StateProvince != null ? ", " + this.StateProvince.Name : "")
                + (string.IsNullOrEmpty(this.PostalCode) ? "" : ", " + this.PostalCode)
                + ((this.StateProvince != null && this.StateProvince.CountryRegion != null) ? ", " + this.StateProvince.CountryRegion.Name : "");
        }
    }
}
